package com.jic.market.impl.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.Builder;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @author xuyongliang
 * @version V1.0
 * @className ExcelListener
 * @description excel监听处理
 * @date 2020/3/20
 */


@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ExcelListener extends AnalysisEventListener {

//    /**
//     * 自定义用于暂时存储data。可以通过实例获取该值
//     */
//    protected List<Object> datas = new ArrayList<>();

    protected ExcelListenerData elData =new ExcelListenerData();

    /**
     * 通过 AnalysisContext 对象还可以获取当前 sheet，当前行等数据
     */
    @Override
    public void invoke(Object object, AnalysisContext context) {

    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        /*
            datas.clear();
            解析结束销毁不用的资源
         */
    }

}
